﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NLLSite.Administrator
{
    public partial class SiteAdministrator : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["objadmin"] != null)
            {
                DAL_Class.Administrator ad = (DAL_Class.Administrator)Session["objadmin"];
                lblNameUser.Text = ad.FullName;
                //Response.Redirect("Quanlytacgia.aspx");
                if (Session["role"].ToString().Equals("Administrator"))
                {
                    lblQuanLyAdmin.Text = "<li><a class=\"h-ico ico-users\" href=\"QuanLyAdmin.aspx\"><span>Quản trị viên</span></a></li>";
                    lblCauHinhGuiMail.Text = "<li><a class=\"h-ico ico-advanced\" href=\"CauHinhGuiMail.aspx\"><span>Cấu hình gửi Mail</span></a></li>";
                }
            }
            else
            {
                Response.Redirect("Login.aspx");
            }            
        }

        protected void lbtLogout_Click(object sender, EventArgs e)
        {
            Session["objadmin"] = null;
            Session["role"] = null;
            Response.Redirect("Login.apsx");
        }

        protected void lbtChangeInfo_Click(object sender, EventArgs e)
        {
            Response.Redirect("ThayDoiThongTin.aspx");
        }
    }
}